from os import system
from sys import argv
import myshop.settings as settings
try:
    if argv[1] == 'ssl':
        system('python manage.py runsslserver --cert 127.0.0.1.crt --key localhost.key')
    elif argv[1] == 'init':
        system('python manage.py makemigrations')
        system('python manage.py migrate')
        system('python manage.py createsuperuser')
    else:
        settings.SECURE_SSL_REDIRECT = False
        system('python manage.py runserver')
except:
    exit(0)